package com.study.tool;



import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

/**
 * Created by wtang on 14-11-24.
 */
public class Start {

    public static void main(String[] args) throws Exception {
         final int port = Integer.getInteger("port",9900);
        final String contextPath = System.getProperty("context", "" +
                "/distributed-client");

        Server server = new Server(port);
        // server.setAttribute("org.mortbay.jetty.Request.maxFormContentSize", -1);
        server.setAttribute("org.eclipse.jetty.server.Request.maxFormContentSize", 5000000);
        WebAppContext context = new WebAppContext("src/main/webapp/", contextPath);
        context.setInitParameter("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
        context.setDescriptor("/src/main/webapp/WEB-INF/applicationContext.xml");
        server.setHandler(context);
        server.setStopAtShutdown(true);
        server.start();
    }
}

